package Test4;

import java.util.*;

public class Set_test {
    public static void main(String[] args) {
        Set<String> list = new TreeSet<String>() ;
            list.add("刘备");
            list.add("关于");
            list.add("张飞");
            list.add("刘备");
            list.add("张飞");
        System.out.println("集合长度为："+list.size());
        Iterator<String> list1=list.iterator();

        while (list1.hasNext()) {
            Object next =  list1.next();
            System.out.print(next+"\t");

        }
        System.out.println();
        for (String s : list) {
        }
        System.out.print(list+"\t");

    }
}

